<template>
	<template v-if="isAlready">
		<el-card :shadow="module.props.shadow" :style="'border:'+module.props.border+';'">
			<template #header v-if="(module.props.showName&&module.name)||module.props.closeable">
				<div style="text-align: left;margin: -8px -15px -15px 0;height:20px;">
					<div v-if="module.props.showName&&module.name" style="float: left;">
						<span>{{ module.name }}</span>
					</div>
					<div v-if="module.props.closeable" style="float:right;text-align: right;cursor: pointer;">
						<el-icon @click='module.props.visible=false' style="margin-left: 7px;">
							<component is="el-icon-close"></component>
						</el-icon>
					</div>
				</div>
			</template>
			<template #default>
				<m-empty v-if="module.props.type==='m-empty'" :model="model" :modules="modules" :module="module"
						 :drag="drag"></m-empty>
				<m-tabs v-if="module.props.type==='m-tabs'" :model="model" :modules="modules" :module="module"
						:drag="drag"></m-tabs>
			</template>
		</el-card>
	</template>
</template>
<script>

import MEmpty from "@/views/asset/card/module/items/m-empty.vue";
import MTabs from "@/views/asset/card/module/items/m-tabs.vue";

export default {
	name: "exModule",
	components: {MTabs, MEmpty},
	props: {
		model: {type: Object, default: {}},
		modules: {type: Array, default: []},
		module: {type: Object, default: null},
		drag: {type: Boolean, default: false},
	},
	data() {
		return {
			isAlready: false,
		}
	},
	created() {
		this.isAlready = true;
	},
	methods: {}
}
</script>
<script setup>
</script>
